#ifndef INDIVIDUAL_H
#define INDIVIDUAL_H

#include <QHash>
#include <QString>
#include <QStringList>

#include "locus.h"

class Individual {

public:
    Individual();

    QString getStrata( QString key );
    qreal getSpatial( QString key );
    qreal getExternal( QString key );
    Locus* getLocus( QString key );
    QString getData( QString key );

    inline void setStrata( QString key, QString val )   { _strata[key] = val; }
    inline void setSpatial( QString key, qreal val )  { _spatial[key] = val; }
    inline void setExternal( QString key, qreal val ) { _external[key] = val; }
    inline void setLocus( QString key, Locus* val )    { _loci[key] = val; }

    inline bool hasStrata( QString key )    { return _strata.keys().contains( key ); }
    inline bool hasSpatial( QString key )   { return _spatial.keys().contains( key ); }
    inline bool hasExternal( QString key )  { return _external.keys().contains( key ); }
    inline bool hasLocus( QString key )     { return _loci.keys().contains( key ); }

    QStringList strataNames();
    QStringList spatialNames();
    QStringList externalNames();
    QStringList locusNames();

    inline void removeStrata( QString key )     { _strata.remove( key ); }
    inline void removeSpatial( QString key )    { _spatial.remove( key ); }
    inline void removeExternal( QString key )   { _external.remove( key ); }
    inline void removeLocus( QString key )      { _loci.remove(key); }

    inline int count() { return _strata.keys().count() + _spatial.keys().count() + _external.keys().count() + _loci.keys().count(); }



    QString toString();

private:
    QHash<QString,QString>  _strata;
    QHash<QString,qreal>    _spatial;
    QHash<QString,qreal>    _external;
    QHash<QString,Locus*>  _loci;

};

#endif // INDIVIDUAL_H
